package com.ruoyi.asset.service.impl;

import com.ruoyi.asset.domain.BackMediaFile;
import com.ruoyi.asset.mapper.BackMediaFileMapper;
import com.ruoyi.asset.service.IBackMediaFileService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 多媒体附件关联Service业务层处理
 *
 * @author hghi
 * @date 2022-06-26
 */
@Service
public class BackMediaFileServiceImpl implements IBackMediaFileService {

    @Resource
    private BackMediaFileMapper backMediaFileMapper;

    /**
     * 查询多媒体附件关联
     *
     * @param id 多媒体附件关联主键
     * @return 多媒体附件关联
     */
    @Override
    public BackMediaFile selectBackMediaFileById(Long id) {
        return backMediaFileMapper.selectBackMediaFileById(id);
    }

    /**
     * 查询多媒体附件关联列表
     *
     * @param backMediaFile 多媒体附件关联
     * @return 多媒体附件关联
     */
    @Override
    public List<BackMediaFile> selectBackMediaFileList(BackMediaFile backMediaFile) {
        return backMediaFileMapper.selectBackMediaFileList(backMediaFile);
    }

    /**
     * 新增多媒体附件关联
     *
     * @param backMediaFile 多媒体附件关联
     * @return 结果
     */
    @Override
    public int insertBackMediaFile(BackMediaFile backMediaFile) {
        return backMediaFileMapper.insertBackMediaFile(backMediaFile);
    }

    /**
     * 修改多媒体附件关联
     *
     * @param backMediaFile 多媒体附件关联
     * @return 结果
     */
    @Override
    public int updateBackMediaFile(BackMediaFile backMediaFile) {
        return backMediaFileMapper.updateBackMediaFile(backMediaFile);
    }

    /**
     * 批量删除多媒体附件关联
     *
     * @param ids 需要删除的多媒体附件关联主键
     * @return 结果
     */
    @Override
    public int deleteBackMediaFileByIds(Long[] ids) {
        return backMediaFileMapper.deleteBackMediaFileByIds(ids);
    }

    /**
     * 删除多媒体附件关联信息
     *
     * @param id 多媒体附件关联主键
     * @return 结果
     */
    @Override
    public int deleteBackMediaFileById(Long id) {
        return backMediaFileMapper.deleteBackMediaFileById(id);
    }

    @Override
    public int deleteBackMediaFileByFileId(Long fileId) {
        return backMediaFileMapper.deleteBackMediaFileByFileId(fileId);
    }

    @Override
    public int deleteBackMediaFileByAssetsId(Long fileId) {
        return backMediaFileMapper.deleteBackMediaFileByAssetsId(fileId);
    }
}
